<template>
    <div class="Paginationw w-flex3">
        <div class="left">
            共 {{ pagesObj?.allNums }}条记录 第 1 / {{ pagesObj?.allPage }} 页
        </div>
        <div class="right w-flex3">
            <div>
                <!--  element ui 组件
                  属性 =》父组件给子组件数据
                  方法=》 就是这个 element ui 库 =》 给我的数据 =》子组件给父组件数据
                -->
                <el-pagination @current-change="handleCurrentChange" small background layout="prev, pager, next"
                    :page-size="pagesObj?.pageNums" :total="pagesObj?.allNums" class="mt-4" />
            </div>
            <div class="right-two w-flex3">
                <!-- 下拉选择框 -->
                <div class="right-two1">
                    <ComSelect :placeholder="`${pagesObj?.pageNums}` + '条/页'"></ComSelect>
                </div>
                跳转到 <div class="right-two2">
                    <Inputw placeholder="1"></Inputw>
                </div>
            </div>
        </div>
    </div>
</template>

<script setup lang="ts">
import ComSelect from '../ComSelect/index.vue'
import Inputw from '../Inputw/index.vue'

defineProps({
    pagesObj: {
        type: Object,

    }
})

let emits = defineEmits(['getPageData'])



const handleCurrentChange = (val: any) => {
    console.log(val);
    console.log(555552);
    //发送请求 =》第二页发送请求 =>子组件给父组件数据
    emits('getPageData', val)
}
</script>

<style scoped lang="scss">
.Paginationw {
    margin-top: 20px;
}

.right-two {
    width: 300px;
}

.right-two1 {
    width: 120px;
}

.right-two2 {
    width: 60px;
}
</style>